
import {BASE_URL} from './config.js'
const request = (method,url,data) => {
//形参
	return new Promise((resolve, reject) => {
		
		uni.request({
		    url: BASE_URL+url, //仅为示例，并非真实接口地址。
		    data,
			method,
		    header: {
		        'Authorization':uni.getStorageSync("token") //自定义请求头信息
		    },
		    success: (res) => {
	
				resolve(res.data);
				
		    },
			fail(){
				reject();
			}
		});

	})
}

export const get=(url,params)=>{
	
	return request("GET",url,params)
	
}
export const post=(url,data)=>{
	
	return request("POST",url,data)
	
}